<!-- 简介详情 -->
<template>
  <el-card>
    <template #header>
      <el-button @click="$router.go(-1)">返回</el-button>
    </template>
    <div>
      <el-descriptions title="简介详情" direction="vertical" :column="2" border>
        <el-descriptions-item label="机构名称">{{
          form.name
        }}</el-descriptions-item>
        <el-descriptions-item label="机构照片">
          <template>
            <el-image
              v-for="i in photosList"
              :key="i"
              :src="img + '/' + i"
              style="width: 150px; height:150px"
              :preview-src-list="[img + '/' + i]"
              lazy
            ></el-image>
          </template>
        </el-descriptions-item>
        <el-descriptions-item label="机构证书">
          <template>
            <el-image
              style="width: 150px; height: 150px"
              fit="cover"
              v-for="i in zsList"
              :key="i"
              :src="img + '/' + i"
              lazy
            ></el-image>
          </template>
        </el-descriptions-item>
        <el-descriptions-item label="机构资质">
          <template>
            <el-image
              style="width: 150px; height: 150px"
              fit="cover"
              v-for="i in certificationList"
              :key="i"
              :src="img + '/' + i"
              lazy
            ></el-image>
          </template>
        </el-descriptions-item>
        <el-descriptions-item label="机构简介">{{
          form.description
        }}</el-descriptions-item>
      </el-descriptions>
    </div>
  </el-card>
</template>
<script>
import Template from "../../system/template.vue";
export default {
  name: "synopsisDetail",
  components: { Template },
  data() {
    return {
      form: {},
      img: window.api.image,
      urls: [],
      photosList:[],
      zsList:[],
      certificationList:[]
    };
  },
  mounted() {
    if (this.$route.query.id) {
      this.API.getRecoveryInstituteById({ id: this.$route.query.id }).then(
        (ret) => {
          this.form = ret.data || []
          console.log("detail:", ret.data);
          this.zsList = this.form.credential.split(',') || [];
          this.photosList = this.form.photos.split(',') || [];
          this.certificationList = this.form.certification.split(',') || [];
        }
      );
    }
  },
};
</script>
  <style scoped lang="scss">
</style>